package com.fusetech.flow.audit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fusetech.flow.audit.domain.AuditProcessForm;
import com.fusetech.flow.audit.mapper.AuditProcessFormMapper;
import com.fusetech.flow.audit.service.dto.AuditProcessFormDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 流程主表表单关系Service
 * @author xx
 * @version 2023-05-06
 */
//@DS("zxhy_platform_db")
@Service
@Transactional
public class AuditProcessFormService extends ServiceImpl<AuditProcessFormMapper, AuditProcessForm> {



	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	public AuditProcessFormDTO findById(String id) {
		return baseMapper.findById ( id );
	}

	/**
	 * 自定义分页检索
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public IPage <AuditProcessFormDTO> findPage(Page <AuditProcessFormDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList (page, queryWrapper);
	}

	public List<AuditProcessForm> selectAuditProcessFormList(AuditProcessForm auditProcessForm)
	{
		return baseMapper.selectAuditProcessFormList(auditProcessForm);
	}

	public int logicDelAuditProcessFormByProcessID(String id)
	{
		return baseMapper.logicDelAuditProcessFormByProcessID(id);
	}

	public int deleteAuditProcessFormByProcessID(String id)
	{
		return baseMapper.deleteAuditProcessFormByProcessID(id);
	}
}
